<template>
  <div class="station-pop">
    <div class="station-pop-title">{{title}}</div>
    <div class="station-pop-content">
      <div class="station-pop-content-item" v-if="stationPopData.stationName">
        <span class="point"></span>
        <div class="content">站点名称：{{stationPopData.stationName}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.routeName">
        <span class="point"></span>
        <div class="content">途径车辆：{{stationPopData.routeName}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.passengerflow">
        <span class="point"></span>
        <div class="content">今日客流：{{stationPopData.passengerflow}}</div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.arriveBusList">
        <span class="point"></span>
        <div class="let-title">即将到达：</div>
        <div class="right-content">
          <div class="right-content-item" v-for="(item, index) in stationPopData.arriveBusList" :key="index">
            {{item}}<img class="item-icon" src="@/assets/images/situational-awareness/dingwei.png">
          </div>
        </div>
      </div>
      <div class="station-pop-content-item" v-if="stationPopData.arrivedBusList">
        <span class="point"></span>
        <div class="let-title">最近到达：</div>
        <div class="right-content">
          <div class="right-content-item" v-for="(item, index) in stationPopData.arrivedBusList" :key="index">
            {{item}}<img class="item-icon" src="@/assets/images/situational-awareness/dingwei.png">
          </div>
        </div>
      </div>
      <!-- <div class="station-pop-content-item" v-if="stationPopData.jingguo">
        <span class="point"></span>
        <div class="content">最近经过：{{stationPopData.jingguo}}</div>
      </div> -->
      <div class="station-pop-content-item" v-if="stationPopData.deviceId">
        <span class="point"></span>
        <div class="let-title">车站监控：</div>
        <div class="right-content">
          <div class="right-content-item" v-for="(item, index) in stationPopData.deviceId" :key="index">
            {{item}}<img class="item-icon" src="@/assets/images/situational-awareness/jiankong.png">
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'
@Component({
  name: 'station-pop'
})
export default class StationPop extends Vue {
  @Prop({
    default: () => {
      return {
        stationName: '站点名称',
        routeName: '经过线路',
        passengerflow: '客流量',
        arriveBusList: [''],
        arrivedBusList: [''],
        deviceId: ['']
      }
    }
  })
  private stationPopData!: any

  @Prop({ default: '站点信息' }) private title!: string

  created() {
    console.log(this.stationPopData, this.title)
  }
}
</script>

<style lang="scss" scoped>
.station-pop {
  box-sizing: border-box;
  width: 294px;
  height: auto;
  border-radius: 8px;
  background: rgba(1, 19, 67, 0.6);
  padding: 22px 20px 20px 20px;
  text-align: left;
  font-family: 'PingFang Regular';
  box-shadow: 0px 3px 20px 3px rgba(3, 125, 220, 0.7);
  &-title {
    font-size: 20px;
    font-weight: bold;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  &-content {
    margin-top: 20px;
    box-sizing: border-box;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    font-family: 'PingFang Regular';
    &-item {
      display: flex;
      box-sizing: border-box;
      width: 100%;
      margin-bottom: 6px;
      .point {
        display: inline-block;
        min-width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #0c81fe;
        margin-top: 7px;
        margin-right: 5px;
      }
      .right-content {
        &-item {
          display: flex;
          align-items: center;
          .item-icon {
            margin-left: 5px;
            width: 16px;
            height: 16px;
          }
        }
      }
    }
  }
}
</style>
